using System;
using System.Runtime.Serialization;

namespace Invoicing.Model.Accounts
{
    [DataContract]
    public class UserModel:MBase
    {
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public int ID { get; set; }
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public string Guid { get; set; }
        [DataMember]
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        public string UserName { get; set; }
        [Model(ConvertType = AttributeType.NotOutput)]
        [DataMember]
        public string Password { get; set; }
        [DataMember]
        [Model]
        public string RealName { get; set; }
        [DataMember]
        [Model]
        public string Mobile { get; set; }
        [DataMember]
        [Model]
        public string Email { get; set; }
        [DataMember]
        [Model]
        public string Description { get; set; }
        [DataMember]
        [Model]
        public int Status { get; set; }
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public System.DateTime CreatedOn { get; set; }
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public Nullable<System.DateTime> LastLoginTime { get; set; }
        [Model(ConvertType = AttributeType.IgnoreUpdate)]
        [DataMember]
        public int LoginTryTimes { get; set; }

        #region Help
        [DataMember]
        public RoleCollection Roles { get; set; }
        #endregion
    }

    [DataContract]
    public class UserCollection : ModelCollectionBase<UserModel> { }
}
